from src.game.ai.state import State
from src.game.entity.arrow import EntityArrow
from pymunk.vec2d import Vec2d

class ShootPlayerState(State):
    
    def __init__(self, priority, entity, radius, damage):
        State.__init__(self, priority, entity)
        self.radius = radius
        self.damage = damage
        
    def shouldStart(self):
        if self.entity.world.player.distanceTo(Vec2d(self.entity.x, self.entity.y)) < self.radius:
            return True
        return False
    
    def shouldContinue(self):
        return self.shouldStart()
    
    def onStart(self):
        pass
    
    def update(self):
        entity = EntityArrow()
        x, y = self.entity.getViewingVector()
        
        
        
        
        